<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use App\Models\Consult;
use App\Models\House;
use App\Models\IntermediaryUser;
use App\Models\NavModule;
use App\Models\Slideshow;
use Illuminate\Http\Request;

class ClientHomePage extends Controller
{
    public function getSlideshow()
    {
        //获取首页轮播图
        $slideshow = Slideshow::getSlideshowList();
        //获取首页导航
        $navData = NavModule::getAllData();
        //返回数据
        return ['code'=>10001,'msg'=>'请求成功','data'=>['slideshow'=>$slideshow,'nav'=>$navData]];
    }

    public function getInformation()
    {
        //获取排行前四的资讯
        $informationData = Consult::getTopList();
        //获取热门楼盘数据
        $hotHousesData = House::getHotHouses();
        //获取经纪人列表
        $brokerData = IntermediaryUser::getBrokerList();
        return ['code'=>10001,'msg'=>'请求成功','data'=>['information'=>$informationData,'hotHouses'=>$hotHousesData,'broker'=>$brokerData]];
    }
}
